summaryrefslogtreecommitdiff
path: root/gerbonara/gerber/tests
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2021-06-13 15:13:29 +0200
committerjaseg <git@jaseg.de>2021-06-13 15:13:29 +0200
commit4bb99811221d0cbbf52e6ab59a76bbe6bd8fba6c (patch)
tree9b491f11c2c77c5e8de8b74eed75162838c5dbf5 /gerbonara/gerber/tests
parent83e498b8917e0b3287871c27a4acc95634acab2e (diff)
downloadgerbonara-4bb99811221d0cbbf52e6ab59a76bbe6bd8fba6c.tar.gz
gerbonara-4bb99811221d0cbbf52e6ab59a76bbe6bd8fba6c.tar.bz2
gerbonara-4bb99811221d0cbbf52e6ab59a76bbe6bd8fba6c.zip
Make pcb-tools pytest pass without warnings
Diffstat (limited to 'gerbonara/gerber/tests')
-rw-r--r--gerbonara/gerber/tests/test_cairo_backend.py2
-rw-r--r--gerbonara/gerber/tests/test_common.py4
-rw-r--r--gerbonara/gerber/tests/test_excellon.py6
3 files changed, 6 insertions, 6 deletions
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")