Skip to content

Commit

Permalink
Improve test compatibility with pytest
Browse files Browse the repository at this point in the history
Also make it simpler to eventually split the single test file we currently have.
  • Loading branch information
saghul committed Dec 10, 2022
1 parent 356118f commit b516583
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ jobs:
- name: Build package
run: python -m pip install .
- name: Run tests
run: python tests/tests.py
run: python -m unittest -v
15 changes: 5 additions & 10 deletions PYPIREADME.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,11 @@ You can force this at installation time as follows:
Running the test suite
----------------------

There are several ways of running the test suite:
From the top level directory, run: ``python -m unittest -v``

- Run the test with the current Python interpreter:

From the toplevel directory, run: ``python tests/tests.py``

- Use Tox to run the test suite in several virtualenvs with several interpreters

From the toplevel directory, run: ``tox -e py36,py37,py38,py39`` this will run the test suite
on Python 3.6 through 3.9 (you'll need to have them installed beforehand)
NOTE: Running the tests requires internet access and are somewhat environment sensitive because real DNS quesries
are made, there is no mocking. If you observe a failure that the CI cannot reproduce, please try to setup an
environment as close as the current CI.


Using it from the cli, a la dig
Expand Down Expand Up @@ -114,7 +109,7 @@ Unless stated otherwise on-file pycares uses the MIT license, check LICENSE file
Supported Python versions
-------------------------

Python >= 3.6 are supported. Both CPython and PyPy are supported.
Python >= 3.7 are supported. Both CPython and PyPy are supported.


Contributing
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ You can force this at installation time as follows:
Running the test suite
----------------------

From the top level directory, run: ``python tests/tests.py``
From the top level directory, run: ``python -m unittest -v``

NOTE: Running the tests requires internet access and are somewhat environment sensitive because real DNS quesries
are made, there is no mocking. If you observe a failure that the CI cannot reproduce, please try to setup an
Expand Down
Empty file added tests/__init__.py
Empty file.
File renamed without changes.

0 comments on commit b516583

Please sign in to comment.