|
10 | 10 |
|
11 | 11 |
|
12 | 12 | @pytest.fixture
|
13 |
| -def sample_rust_report(mocker): |
14 |
| - mocker.patch.object(ReadOnlyReport, "should_load_rust_version", return_value=True) |
| 13 | +def sample_rust_report(): |
15 | 14 | with open(current_file.parent / "samples" / "chunks_01.txt", "r") as f:
|
16 | 15 | chunks = f.read()
|
17 | 16 | files_dict = {
|
@@ -74,10 +73,7 @@ class TestReadOnly(object):
|
74 | 73 | @pytest.mark.parametrize(
|
75 | 74 | "report_header", [{}, {"labels_index": {0: "special_label", 1: "some_test"}}]
|
76 | 75 | )
|
77 |
| - def test_create_from_report(self, sample_report, mocker, report_header): |
78 |
| - mocker.patch.object( |
79 |
| - ReadOnlyReport, "should_load_rust_version", return_value=True |
80 |
| - ) |
| 76 | + def test_create_from_report(self, sample_report, report_header): |
81 | 77 | sample_report._header = report_header
|
82 | 78 | r = ReadOnlyReport.create_from_report(sample_report)
|
83 | 79 | assert r.rust_report is not None
|
@@ -220,9 +216,6 @@ def test_get_file_totals(self, sample_report, mocker):
|
220 | 216 |
|
221 | 217 | def test_from_chunks_with_totals(self, mocker):
|
222 | 218 | mocked_process_totals = mocker.patch.object(ReadOnlyReport, "_process_totals")
|
223 |
| - mocker.patch.object( |
224 |
| - ReadOnlyReport, "should_load_rust_version", return_value=True |
225 |
| - ) |
226 | 219 | with open(current_file.parent / "samples" / "chunks_01.txt", "r") as f:
|
227 | 220 | chunks = f.read()
|
228 | 221 | files_dict = {
|
@@ -320,68 +313,6 @@ def test_filter_none(self, sample_rust_report):
|
320 | 313 | assert sample_rust_report.rust_report.get_report() is not None
|
321 | 314 | assert sample_rust_report.filter() is sample_rust_report
|
322 | 315 |
|
323 |
| - def test_init_no_loading_rust(self, mocker): |
324 |
| - chunks = "\n".join( |
325 |
| - ["{}", "", "", "[1, null, [[0, 1], [1, 0]]]", "[0, null, [[0, 0], [1, 0]]]"] |
326 |
| - ) |
327 |
| - files_dict = { |
328 |
| - "awesome/__init__.py": [ |
329 |
| - 2, |
330 |
| - [0, 10, 8, 2, 0, "80.00000", 0, 0, 0, 0, 0, 0, 0], |
331 |
| - [[0, 10, 8, 2, 0, "80.00000", 0, 0, 0, 0, 0, 0, 0]], |
332 |
| - [0, 2, 1, 1, 0, "50.00000", 0, 0, 0, 0, 0, 0, 0], |
333 |
| - ], |
334 |
| - "tests/__init__.py": [ |
335 |
| - 0, |
336 |
| - [0, 3, 2, 1, 0, "66.66667", 0, 0, 0, 0, 0, 0, 0], |
337 |
| - [[0, 3, 2, 1, 0, "66.66667", 0, 0, 0, 0, 0, 0, 0]], |
338 |
| - None, |
339 |
| - ], |
340 |
| - "tests/test_sample.py": [ |
341 |
| - 1, |
342 |
| - [0, 7, 7, 0, 0, "100", 0, 0, 0, 0, 0, 0, 0], |
343 |
| - [[0, 7, 7, 0, 0, "100", 0, 0, 0, 0, 0, 0, 0]], |
344 |
| - None, |
345 |
| - ], |
346 |
| - } |
347 |
| - sessions_dict = { |
348 |
| - "0": { |
349 |
| - "N": None, |
350 |
| - "a": "v4/raw/2019-01-10/4434BC2A2EC4FCA57F77B473D83F928C/abf6d4df662c47e32460020ab14abf9303581429/9ccc55a1-8b41-4bb1-a946-ee7a33a7fb56.txt", |
351 |
| - "c": None, |
352 |
| - "d": 1547084427, |
353 |
| - "e": None, |
354 |
| - "f": ["unit"], |
355 |
| - "j": None, |
356 |
| - "n": None, |
357 |
| - "p": None, |
358 |
| - "t": [3, 20, 17, 3, 0, "85.00000", 0, 0, 0, 0, 0, 0, 0], |
359 |
| - "": None, |
360 |
| - } |
361 |
| - } |
362 |
| - mocker.patch.object( |
363 |
| - ReadOnlyReport, "should_load_rust_version", return_value=False |
364 |
| - ) |
365 |
| - r = ReadOnlyReport.from_chunks( |
366 |
| - chunks=chunks, files=files_dict, sessions=sessions_dict |
367 |
| - ) |
368 |
| - assert r.rust_report is None |
369 |
| - assert r.totals == ReportTotals( |
370 |
| - files=3, |
371 |
| - lines=20, |
372 |
| - hits=17, |
373 |
| - misses=3, |
374 |
| - partials=0, |
375 |
| - coverage="85.00000", |
376 |
| - branches=0, |
377 |
| - methods=0, |
378 |
| - messages=0, |
379 |
| - sessions=1, |
380 |
| - complexity=0, |
381 |
| - complexity_total=0, |
382 |
| - diff=0, |
383 |
| - ) |
384 |
| - |
385 | 316 | def test_init(self, sample_rust_report):
|
386 | 317 | report = sample_rust_report
|
387 | 318 | assert report.totals.asdict() == {
|
|
0 commit comments