Skip to content

Commit

Permalink
Remove use of TestCommand (#377)
Browse files Browse the repository at this point in the history
This PR removes the use of `TestCommand` and uses `Command` instead. `setuptools` is set to remove `TestCommand` in November. Closes #376.
  • Loading branch information
mrashed-dev authored Jul 30, 2024
1 parent 2e869bc commit b25f3ec
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
import sys
import re
import subprocess
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
from setuptools import setup, find_packages, Command


VERSION = ""
Expand Down Expand Up @@ -36,11 +35,10 @@
RELEASE_DEPENDENCIES = ["bumpversion>=0.6.0", "twine>=4.0.2"]


class PyTest(TestCommand):
class PyTest(Command):
user_options = [("pytest-args=", "a", "Arguments to pass to pytest")]

def initialize_options(self):
TestCommand.initialize_options(self)
# pylint: disable=attribute-defined-outside-init
self.pytest_args = [
"--cov",
Expand All @@ -52,12 +50,11 @@ def initialize_options(self):
self.lint = False

def finalize_options(self):
TestCommand.finalize_options(self)
# pylint: disable=attribute-defined-outside-init
self.test_args = []
self.test_suite = True

def run_tests(self):
def run(self):
# import here, cause outside the eggs aren't loaded
import pytest

Expand Down

0 comments on commit b25f3ec

Please sign in to comment.