Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Remove pytest import from top of module #216

Merged
merged 1 commit into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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__)"
Loading