From 1382eabb3f27d7c9cd5328fb7fddd1ded98121fb Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Fri, 8 May 2020 06:23:50 -0700 Subject: [PATCH] Remove deprecated use of 'setup.py test' (#1275) Since setuptools v41.5.0 (27 Oct 2019), the 'test' command is formally deprecated and should not be used. Now use unittest as the test entry point. --- .github/ISSUE_TEMPLATE/bug_report.md | 2 +- .github/workflows/test.yml | 2 +- .travis.yml | 2 +- CONTRIBUTING.md | 2 +- setup.py | 1 - tests/__init__.py | 0 6 files changed, 4 insertions(+), 5 deletions(-) create mode 100644 tests/__init__.py diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index e2e468a..e652f17 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -29,7 +29,7 @@ assignees: "" - create a new virtualenv (make sure it's the same Python version); - clone this repository; - run `pip install -e .`; - - make sure it's sane by running `python setup.py test`; and + - make sure it's sane by running `python -m unittest`; and - run `black` like you did last time. **Additional context** Add any other context about the problem here. diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index de734da..c2671da 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -27,4 +27,4 @@ jobs: - name: Unit tests run: | - coverage run tests/test_black.py + coverage run -m unittest diff --git a/.travis.yml b/.travis.yml index ec24172..19b60a4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ cache: directories: - $HOME/.cache/pre-commit env: - - TEST_CMD="coverage run tests/test_black.py" + - TEST_CMD="coverage run -m unittest" install: - pip install coverage coveralls pre-commit - pip install -e '.[d]' diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d620275..91e5320 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -37,7 +37,7 @@ from the cloned _Black_ repo. It will do the correct thing. Before submitting pull requests, run tests with: ``` -$ python setup.py test +$ python -m unittest ``` ## Hygiene diff --git a/setup.py b/setup.py index fb3b91f..6192131 100644 --- a/setup.py +++ b/setup.py @@ -78,7 +78,6 @@ setup( "mypy_extensions>=0.4.3", ], extras_require={"d": ["aiohttp>=3.3.2", "aiohttp-cors"]}, - test_suite="tests.test_black", classifiers=[ "Development Status :: 4 - Beta", "Environment :: Console", diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e69de29 -- 2.39.5