Skip to content

Commit

Permalink
Merge pull request #216 from bashtage/remove-pytest-import
Browse files Browse the repository at this point in the history
BUG: Remove pytest import from top of module
  • Loading branch information
bashtage authored Nov 12, 2024
2 parents a514e0c + af3f8bc commit 3063436
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
16 changes: 8 additions & 8 deletions patsy/eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import tokenize
import ast
import numbers
import pytest
from patsy import PatsyError
from patsy.util import PushbackAdapter, no_pickling, assert_no_pickling
from patsy.tokens import pretty_untokenize, normalize_token_spacing, python_tokenize
Expand Down Expand Up @@ -424,14 +423,15 @@ def test_EvalEnvironment_subset():
pytest.raises(NameError, subset_bc.eval, "a")


@pytest.mark.skipif(
sys.version_info >= (3, 13),
reason=(
"`frame.f_locals` may return write-through proxies in Python 3.13+, "
"breaking direct comparison by ids."
),
)
def test_EvalEnvironment_eq():
import pytest

if sys.version_info >= (3, 13):
pytest.skip(
"`frame.f_locals` may return write-through proxies in Python 3.13+, "
"breaking direct comparison by ids."
)

# Two environments are eq only if they refer to exactly the same
# global/local dicts
env1 = EvalEnvironment.capture(0)
Expand Down
2 changes: 2 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,5 @@ commands=
pytest -vv --cov=patsy --cov-config={toxinidir}/.coveragerc --cov-report=term-missing --cov-report=xml --cov-report=html:{toxworkdir}/coverage/{envname} {posargs:}
env PATSY_AVOID_OPTIONAL_DEPENDENCIES=1 pytest -vv --cov=patsy --cov-config={toxinidir}/.coveragerc --cov-report=term-missing --cov-report=xml --cov-report=html:{toxworkdir}/coverage/{envname} {posargs:}
python {toxinidir}/tools/check-API-refs.py
python -m pip uninstall pytest -y
python -c "import patsy; print(patsy.__version__)"

0 comments on commit 3063436

Please sign in to comment.