Merge branch 'main' of github.com:chuckyQ/pytest
This commit is contained in:
commit
eea8bab283
|
@ -23,7 +23,7 @@ repos:
|
||||||
exclude: _pytest/(debugging|hookspec).py
|
exclude: _pytest/(debugging|hookspec).py
|
||||||
language_version: python3
|
language_version: python3
|
||||||
- repo: https://github.com/PyCQA/autoflake
|
- repo: https://github.com/PyCQA/autoflake
|
||||||
rev: v2.0.2
|
rev: v2.1.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: autoflake
|
- id: autoflake
|
||||||
name: autoflake
|
name: autoflake
|
||||||
|
|
|
@ -1299,12 +1299,12 @@ def test_no_brokenpipeerror_message(pytester: Pytester) -> None:
|
||||||
popen.stderr.close()
|
popen.stderr.close()
|
||||||
|
|
||||||
|
|
||||||
def test_function_return_non_none_warning(testdir) -> None:
|
def test_function_return_non_none_warning(pytester: Pytester) -> None:
|
||||||
testdir.makepyfile(
|
pytester.makepyfile(
|
||||||
"""
|
"""
|
||||||
def test_stuff():
|
def test_stuff():
|
||||||
return "something"
|
return "something"
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
res = testdir.runpytest()
|
res = pytester.runpytest()
|
||||||
res.stdout.fnmatch_lines(["*Did you mean to use `assert` instead of `return`?*"])
|
res.stdout.fnmatch_lines(["*Did you mean to use `assert` instead of `return`?*"])
|
||||||
|
|
|
@ -1167,8 +1167,8 @@ def test_log_file_cli_subdirectories_are_successfully_created(
|
||||||
assert result.ret == ExitCode.OK
|
assert result.ret == ExitCode.OK
|
||||||
|
|
||||||
|
|
||||||
def test_disable_loggers(testdir):
|
def test_disable_loggers(pytester: Pytester) -> None:
|
||||||
testdir.makepyfile(
|
pytester.makepyfile(
|
||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
|
@ -1181,13 +1181,13 @@ def test_disable_loggers(testdir):
|
||||||
assert caplog.record_tuples == [('test', 10, 'Visible text!')]
|
assert caplog.record_tuples == [('test', 10, 'Visible text!')]
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
result = testdir.runpytest("--log-disable=disabled", "-s")
|
result = pytester.runpytest("--log-disable=disabled", "-s")
|
||||||
assert result.ret == ExitCode.OK
|
assert result.ret == ExitCode.OK
|
||||||
assert not result.stderr.lines
|
assert not result.stderr.lines
|
||||||
|
|
||||||
|
|
||||||
def test_disable_loggers_does_not_propagate(testdir):
|
def test_disable_loggers_does_not_propagate(pytester: Pytester) -> None:
|
||||||
testdir.makepyfile(
|
pytester.makepyfile(
|
||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
|
@ -1205,13 +1205,13 @@ def test_disable_loggers_does_not_propagate(testdir):
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
result = testdir.runpytest("--log-disable=parent.child", "-s")
|
result = pytester.runpytest("--log-disable=parent.child", "-s")
|
||||||
assert result.ret == ExitCode.OK
|
assert result.ret == ExitCode.OK
|
||||||
assert not result.stderr.lines
|
assert not result.stderr.lines
|
||||||
|
|
||||||
|
|
||||||
def test_log_disabling_works_with_log_cli(testdir):
|
def test_log_disabling_works_with_log_cli(pytester: Pytester) -> None:
|
||||||
testdir.makepyfile(
|
pytester.makepyfile(
|
||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
disabled_log = logging.getLogger('disabled')
|
disabled_log = logging.getLogger('disabled')
|
||||||
|
@ -1222,7 +1222,7 @@ def test_log_disabling_works_with_log_cli(testdir):
|
||||||
disabled_log.warning("This string will be suppressed.")
|
disabled_log.warning("This string will be suppressed.")
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
result = testdir.runpytest(
|
result = pytester.runpytest(
|
||||||
"--log-cli-level=DEBUG",
|
"--log-cli-level=DEBUG",
|
||||||
"--log-disable=disabled",
|
"--log-disable=disabled",
|
||||||
)
|
)
|
||||||
|
|
|
@ -8,7 +8,7 @@ pytest-flakes==4.0.5
|
||||||
pytest-html==3.2.0
|
pytest-html==3.2.0
|
||||||
pytest-mock==3.10.0
|
pytest-mock==3.10.0
|
||||||
pytest-rerunfailures==11.1.2
|
pytest-rerunfailures==11.1.2
|
||||||
pytest-sugar==0.9.5
|
pytest-sugar==0.9.7
|
||||||
pytest-trio==0.7.0
|
pytest-trio==0.7.0
|
||||||
pytest-twisted==1.14.0
|
pytest-twisted==1.14.0
|
||||||
twisted==22.8.0
|
twisted==22.8.0
|
||||||
|
|
Loading…
Reference in New Issue