Remove/replace some unneeded usages of py.path
This commit is contained in:
@@ -3,9 +3,9 @@ import os
|
||||
import shlex
|
||||
import subprocess
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
from _pytest.compat import legacy_path
|
||||
from _pytest.config import argparsing as parseopt
|
||||
from _pytest.config.exceptions import UsageError
|
||||
from _pytest.monkeypatch import MonkeyPatch
|
||||
@@ -123,11 +123,11 @@ class TestParser:
|
||||
assert not getattr(args, parseopt.FILE_OR_DIR)
|
||||
|
||||
def test_parse2(self, parser: parseopt.Parser) -> None:
|
||||
args = parser.parse([legacy_path(".")])
|
||||
assert getattr(args, parseopt.FILE_OR_DIR)[0] == legacy_path(".")
|
||||
args = parser.parse([Path(".")])
|
||||
assert getattr(args, parseopt.FILE_OR_DIR)[0] == "."
|
||||
|
||||
def test_parse_known_args(self, parser: parseopt.Parser) -> None:
|
||||
parser.parse_known_args([legacy_path(".")])
|
||||
parser.parse_known_args([Path(".")])
|
||||
parser.addoption("--hello", action="store_true")
|
||||
ns = parser.parse_known_args(["x", "--y", "--hello", "this"])
|
||||
assert ns.hello
|
||||
|
||||
Reference in New Issue
Block a user