Skip to content

Address pytest warnings #101

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

Merged
merged 8 commits into from
Jun 1, 2025
Prev Previous commit
Next Next commit
Fix pypy warnings
  • Loading branch information
fayazkhan committed Jun 1, 2025
commit 1aa86c4aafe56e298a6b4a34f339e93c374778e9
4 changes: 2 additions & 2 deletions sqlalchemy_mptt/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ def __init__(self, session):

def add(self, model, fixtures):
here = os.path.dirname(os.path.realpath(__file__))
file = open(os.path.join(here, fixtures))
fixtures = json.loads(file.read())
with open(os.path.join(here, fixtures)) as file:
fixtures = json.loads(file.read())
for fixture in fixtures:
if hasattr(model, "sqlalchemy_mptt_pk_name"):
fixture[model.sqlalchemy_mptt_pk_name] = fixture.pop("id")
Expand Down