Skip to content

Commit

Permalink
Fix test for pylint 2.9.6
Browse files Browse the repository at this point in the history
Disable "consider-using-with" because there is no way we can avoid using
"with" while assigning instance variable. Similar to pylint bug
pylint-dev/pylint#4430

Also replace @pytest.yield_fixture with @pytest.fixture to avoid
PytestDeprecationWarning
  • Loading branch information
orange-kao committed Aug 23, 2021
1 parent b2b2b99 commit eb30c64
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
logutil.configure_logging()


@pytest.yield_fixture
@pytest.fixture
def pgl():
pgl_ = PgLookout("pglookout.json")
pgl_.config["remote_conns"] = {}
Expand Down Expand Up @@ -75,7 +75,7 @@ def run_cmd(self, cmd, *args):
subprocess.check_call(argv)

def run_pg(self):
self.pg = subprocess.Popen([
self.pg = subprocess.Popen([ # pylint: disable=consider-using-with
os.path.join(self.pgbin, "postgres"),
"-D", self.pgdata, "-k", self.pgdata,
"-p", "5432", "-c", "listen_addresses=",
Expand All @@ -99,7 +99,7 @@ def kill(self, force=True, immediate=True):


# NOTE: cannot use 'tmpdir' fixture here, it only works in 'function' scope
@pytest.yield_fixture(scope="session")
@pytest.fixture(scope="session")
def db():
tmpdir_obj = py_path.local(tempfile.mkdtemp(prefix="pglookout_dbtest_"))
tmpdir = str(tmpdir_obj)
Expand Down

0 comments on commit eb30c64

Please sign in to comment.