From 4bb99811221d0cbbf52e6ab59a76bbe6bd8fba6c Mon Sep 17 00:00:00 2001 From: jaseg Date: Sun, 13 Jun 2021 15:13:29 +0200 Subject: Make pcb-tools pytest pass without warnings --- gerbonara/gerber/tests/test_cairo_backend.py | 2 +- gerbonara/gerber/tests/test_common.py | 4 ++-- gerbonara/gerber/tests/test_excellon.py | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'gerbonara/gerber/tests') diff --git a/gerbonara/gerber/tests/test_cairo_backend.py b/gerbonara/gerber/tests/test_cairo_backend.py index 51007a9..3dc783d 100644 --- a/gerbonara/gerber/tests/test_cairo_backend.py +++ b/gerbonara/gerber/tests/test_cairo_backend.py @@ -221,7 +221,7 @@ def _test_render(gerber_path, png_expected_path, create_output_path=None): ctx = GerberCairoContext() gerber.render(ctx) - actual_bytes = ctx.dump(None) + actual_bytes = ctx.dump_str() # If we want to write the file bytes, do it now. This happens if create_output_path: diff --git a/gerbonara/gerber/tests/test_common.py b/gerbonara/gerber/tests/test_common.py index a6b1264..e4c023c 100644 --- a/gerbonara/gerber/tests/test_common.py +++ b/gerbonara/gerber/tests/test_common.py @@ -24,9 +24,9 @@ def test_file_type_detection(): def test_load_from_string(): - with open(NCDRILL_FILE, "rU") as f: + with open(NCDRILL_FILE, "r") as f: ncdrill = loads(f.read()) - with open(TOP_COPPER_FILE, "rU") as f: + with open(TOP_COPPER_FILE, "r") as f: top_copper = loads(f.read()) assert isinstance(ncdrill, ExcellonFile) assert isinstance(top_copper, GerberFile) diff --git a/gerbonara/gerber/tests/test_excellon.py b/gerbonara/gerber/tests/test_excellon.py index d6e83cc..ef34f67 100644 --- a/gerbonara/gerber/tests/test_excellon.py +++ b/gerbonara/gerber/tests/test_excellon.py @@ -17,7 +17,7 @@ NCDRILL_FILE = os.path.join(os.path.dirname(__file__), "resources/ncdrill.DRD") def test_format_detection(): """ Test file type detection """ - with open(NCDRILL_FILE, "rU") as f: + with open(NCDRILL_FILE, "r") as f: data = f.read() settings = detect_excellon_format(data) assert settings["format"] == (2, 4) @@ -36,9 +36,9 @@ def test_read(): def test_write(): ncdrill = read(NCDRILL_FILE) ncdrill.write("test.ncd") - with open(NCDRILL_FILE, "rU") as src: + with open(NCDRILL_FILE, "r") as src: srclines = src.readlines() - with open("test.ncd", "rU") as res: + with open("test.ncd", "r") as res: for idx, line in enumerate(res): assert line.strip() == srclines[idx].strip() os.remove("test.ncd") -- cgit