Merge pull request #6510 from blueyed/typing-fixes
typing: fix some "incompatible types in assignment" with py
This commit is contained in:
commit
d347a30656
|
@ -97,8 +97,10 @@ def getlocation(function, curdir=None) -> str:
|
||||||
function = get_real_func(function)
|
function = get_real_func(function)
|
||||||
fn = py.path.local(inspect.getfile(function))
|
fn = py.path.local(inspect.getfile(function))
|
||||||
lineno = function.__code__.co_firstlineno
|
lineno = function.__code__.co_firstlineno
|
||||||
if curdir is not None and fn.relto(curdir):
|
if curdir is not None:
|
||||||
fn = fn.relto(curdir)
|
relfn = fn.relto(curdir)
|
||||||
|
if relfn:
|
||||||
|
return "%s:%d" % (relfn, lineno + 1)
|
||||||
return "%s:%d" % (fn, lineno + 1)
|
return "%s:%d" % (fn, lineno + 1)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -121,7 +121,9 @@ def determine_setup(
|
||||||
sections = ["tool:pytest", "pytest"] if is_cfg_file else ["pytest"]
|
sections = ["tool:pytest", "pytest"] if is_cfg_file else ["pytest"]
|
||||||
for section in sections:
|
for section in sections:
|
||||||
try:
|
try:
|
||||||
inicfg = iniconfig[section]
|
inicfg = iniconfig[
|
||||||
|
section
|
||||||
|
] # type: Optional[py.iniconfig._SectionWrapper]
|
||||||
if is_cfg_file and section == "pytest" and config is not None:
|
if is_cfg_file and section == "pytest" and config is not None:
|
||||||
fail(
|
fail(
|
||||||
CFG_PYTEST_SECTION.format(filename=str(inifile)), pytrace=False
|
CFG_PYTEST_SECTION.format(filename=str(inifile)), pytrace=False
|
||||||
|
|
Loading…
Reference in New Issue