Skip to content

Commit

Permalink
BUG: Remove pytest import from top of module
Browse files Browse the repository at this point in the history
Move import to within the test function and change skip method
  • Loading branch information
bashtage committed Nov 12, 2024
1 parent a514e0c commit 7b4fd0c
Showing 1 changed file with 8 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

0 comments on commit 7b4fd0c

Please sign in to comment.