Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
Carreau committed Dec 5, 2023
1 parent a0d4bd7 commit dbd1a2f
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions tests/test_cmdline.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import tempfile
from textwrap import dedent

from pyflyby._util import EnvVarCtx
from pyflyby._util import EnvVarCtx, CwdCtx

import pytest

Expand Down Expand Up @@ -790,23 +790,23 @@ class B:
from foo import A, B
""").lstrip())
dot_pyflyby_fp.flush()
with CwdCtx(temp_dir):
result = pipe(
[BIN_DIR + "/tidy-imports", foo_fp.name],
env={"PYFLYBY_PATH": dot_pyflyby},
)

expected = dedent(
"""
from __future__ import annotations
os.chdir(temp_dir)
result = pipe([
BIN_DIR+"/tidy-imports", foo_fp.name
], env={
"PYFLYBY_PATH": dot_pyflyby
})

expected = dedent("""
from __future__ import annotations
class A:
param1: str
param2: B
class A:
param1: str
param2: B
class B:
param1: str
""").strip()
class B:
param1: str
"""
).strip()
assert result == expected

0 comments on commit dbd1a2f

Please sign in to comment.