Skip to content

Commit

Permalink
Merge pull request #1270 from skirpichev/move-conftest
Browse files Browse the repository at this point in the history
Use diofant/tests/config.py as a default pytest plugin
  • Loading branch information
skirpichev committed Feb 22, 2023
2 parents a2949a8 + 35f4b0a commit 233a9ad
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,13 @@ jobs:
if: matrix.coverage == false
env:
PYTEST_ADDOPTS: --doctest-modules --color yes
PYTHONPATH: .
run: pytest
- name: Coverage tests
if: matrix.coverage
env:
PYTEST_ADDOPTS: --color yes --cov diofant --cov-append -m "not slow and not xfail and not regression" --ignore docs
PYTHONPATH: .
run: |
pytest
pip uninstall -y gmpy2 numpy IPython
Expand Down
8 changes: 5 additions & 3 deletions conftest.py → diofant/tests/config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Pytest configuration and fixtures for the Diofant test suite."""
"""Pytest configuration and fixtures for the Diofant."""

import random
import sys
Expand All @@ -9,9 +9,11 @@


def pytest_report_header(config):
return f"""\nDiofant version: {diofant.__version__}
return f"""
Diofant version: {diofant.__version__}
cache: {diofant.core.cache.USE_CACHE}
ground types: {diofant.core.compatibility.GROUND_TYPES}\n"""
ground types: {diofant.core.compatibility.GROUND_TYPES}
"""


def pytest_configure(config):
Expand Down
1 change: 0 additions & 1 deletion diofant/tests/conftest.py

This file was deleted.

2 changes: 1 addition & 1 deletion docs/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ For a starter guide on using Diofant, refer to the :ref:`tutorial`.
Also, you may want to run full set of unit tests to make
sure everything works::

pytest --pyargs diofant
pytest -p diofant.tests.config --pyargs diofant

`pytest`_ and some other packages are required for testing, so be sure to
install the Diofant first with the optional "tests" list of dependencies::
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ doctest_optionflags = ['ELLIPSIS', 'NORMALIZE_WHITESPACE',
addopts = """\
--durations=20 -r X --doctest-glob='*.rst' \
--cov-config=pyproject.toml -n auto \
-p diofant.tests.config --noconftest \
"""
norecursedirs = ['build', '.eggs', '.git']
timeout = 1000
Expand Down

0 comments on commit 233a9ad

Please sign in to comment.