Skip to content

Commit

Permalink
Provide 'sys.flags.warn_default_encoding' for the tests to skip on Py…
Browse files Browse the repository at this point in the history
…thon 3.7.
  • Loading branch information
jaraco committed Jan 27, 2023
1 parent 10b97f3 commit 8776201
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import sys

import pytest


class Flags:
warn_default_encoding = 0

def __getattr__(self, *args):
return getattr(sys.flags, *args)


@pytest.fixture(scope="session")
def monkeysession():
with pytest.MonkeyPatch.context() as mp:
yield mp


@pytest.fixture(scope="session", autouse=True)
def future_flags(monkeysession):
if sys.version_info > (3, 8):
return
monkeysession.setattr(sys, 'flags', Flags())

0 comments on commit 8776201

Please sign in to comment.