()
| 4518 | |
| 4519 | |
| 4520 | def test_python_version() -> None: |
| 4521 | # test that the py_version can be added as flag |
| 4522 | args = parse_args(["--py=27"]) |
| 4523 | assert args["py_version"] == "27" |
| 4524 | |
| 4525 | args = parse_args(["--python-version=3"]) |
| 4526 | assert args["py_version"] == "3" |
| 4527 | |
| 4528 | test_input = "import os\n\nimport user\n" |
| 4529 | assert isort.code(test_input, py_version="3") == test_input |
| 4530 | |
| 4531 | # user is part of the standard library in python 2 |
| 4532 | output_python_2 = "import os\nimport user\n" |
| 4533 | assert isort.code(test_input, py_version="27") == output_python_2 |
| 4534 | |
| 4535 | test_input = "import os\nimport xml" |
| 4536 | |
| 4537 | print(isort.code(test_input, py_version="all")) |
| 4538 | |
| 4539 | |
| 4540 | def test_isort_with_single_character_import() -> None: |
nothing calls this directly
no test coverage detected