diff --git a/pytest4.patch b/pytest4.patch new file mode 100644 index 0000000..2a8188a --- /dev/null +++ b/pytest4.patch @@ -0,0 +1,60 @@ +--- a/tests/fixtures.py ++++ b/tests/fixtures.py +@@ -21,7 +21,7 @@ def system_path(): + + + @pytest.yield_fixture +-def system(): ++def system(system_path): + ''' + yields the contents of the system.evtx test file. + the returned value is a memory map of the contents, +@@ -30,8 +30,7 @@ def system(): + Returns: + mmap.mmap: the contents of the test file. + ''' +- p = system_path() +- with open(p, 'rb') as f: ++ with open(system_path, 'rb') as f: + with contextlib.closing(mmap.mmap(f.fileno(), 0, + access=mmap.ACCESS_READ)) as buf: + yield buf +@@ -52,7 +51,7 @@ def security_path(): + + + @pytest.yield_fixture +-def security(): ++def security(security_path): + ''' + yields the contents of the security.evtx test file. + the returned value is a memory map of the contents, +@@ -61,8 +60,7 @@ def security(): + Returns: + mmap.mmap: the contents of the test file. + ''' +- p = security_path() +- with open(p, 'rb') as f: ++ with open(security_path, 'rb') as f: + with contextlib.closing(mmap.mmap(f.fileno(), 0, + access=mmap.ACCESS_READ)) as buf: + yield buf +--- a/tests/test_records.py ++++ b/tests/test_records.py +@@ -248,7 +248,7 @@ def test_parse_record(system): + ['EndOfStreamNode']]]]], + ['Substitutions', None, [ + ['WstringTypeNode', 'System'], +- ['WstringTypeNode', 'C:\Windows\System32\Winevt\Logs\Archive-System-2012-03-14-04-17-39-932.evtx']]]]]]]]]]] ++ ['WstringTypeNode', 'C:\\Windows\\System32\\Winevt\\Logs\\Archive-System-2012-03-14-04-17-39-932.evtx']]]]]]]]]]] + + assert extract_structure(record.root()) == expected + +@@ -264,7 +264,7 @@ def test_render_record(system): + chunk = one(fh.chunks()) + record = one(chunk.records()) + +- xml = record.xml() ++ xml = record.xml() + assert xml == textwrap.dedent('''\ + + 105 diff --git a/python-evtx.changes b/python-evtx.changes index 445df8f..7954285 100644 --- a/python-evtx.changes +++ b/python-evtx.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Nov 4 15:05:59 CET 2019 - Matej Cepl + +- Add pytest4.patch making the testsuite running again. + ------------------------------------------------------------------- Thu Aug 22 14:11:28 UTC 2019 - Tomáš Chvátal diff --git a/python-evtx.spec b/python-evtx.spec index 77c9358..fc5df80 100644 --- a/python-evtx.spec +++ b/python-evtx.spec @@ -27,7 +27,7 @@ URL: https://github.com/williballenthin/python-evtx Source: https://github.com/williballenthin/python-evtx/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz BuildRequires: %{python_module hexdump} BuildRequires: %{python_module lxml} -BuildRequires: %{python_module pytest < 4} +BuildRequires: %{python_module pytest} BuildRequires: %{python_module setuptools} BuildRequires: dos2unix BuildRequires: fdupes