Code Duplication    Length = 23-24 lines in 2 locations

tests/test_level2_pp_cli.py 2 locations

@@ 90-113 (lines=24) @@
87
	nccmpattrs(ifile, ofile, ignore=["creation_time", "software"])
88
89
90
@pytest.mark.xfail(
91
	sys.version_info[:2] == (3, 4),
92
	reason="netcdf file attributes don't work with Python 3.4 compatible xarray.",
93
)
94
@pytest.mark.parametrize("revision", TEST_REVISIONS)
95
def test_pp_xarray(revision, tmpdir):
96
	ifile = _gentestfile(IFILE2.format(revision), tmpdir)
97
	ofile = os.path.join(tmpdir, "test_v{0}x_t.nc".format(revision))
98
	p = Popen([
99
		"python", "-m", "sciapy.level2.post_process",
100
		"-A", "The Dude",
101
		"-M", "2010-02",
102
		"-R", revision,
103
		"-p", os.path.join(DATADIR, "l2"),
104
		"-s", os.path.join(DATADIR, "l1c"),
105
		"--mlt",
106
		"-X",
107
		ofile,
108
	])
109
	p.communicate()
110
	p.wait()
111
	assert p.returncode == 0
112
	ncallclose(ifile, ofile)
113
	nccmpattrs(ifile, ofile, ignore=["creation_time", "software"])
114
115
116
@pytest.mark.xfail(
@@ 65-87 (lines=23) @@
62
	assert p.returncode == 0
63
64
65
@pytest.mark.xfail(
66
	sys.version_info[:2] == (3, 4),
67
	reason="netcdf file attributes don't work with Python 3.4 compatible xarray.",
68
)
69
@pytest.mark.parametrize("revision", TEST_REVISIONS)
70
def test_pp_netcdf(revision, tmpdir):
71
	ifile = _gentestfile(IFILE1.format(revision), tmpdir)
72
	ofile = os.path.join(tmpdir, "test_v{0}_t.nc".format(revision))
73
	p = Popen([
74
		"python", "-m", "sciapy.level2.post_process",
75
		"-A", "The Dude",
76
		"-M", "2010-02",
77
		"-R", revision,
78
		"-p", os.path.join(DATADIR, "l2"),
79
		"-s", os.path.join(DATADIR, "l1c"),
80
		"--mlt",
81
		ofile,
82
	])
83
	p.communicate()
84
	p.wait()
85
	assert p.returncode == 0
86
	ncallclose(ifile, ofile)
87
	nccmpattrs(ifile, ofile, ignore=["creation_time", "software"])
88
89
90
@pytest.mark.xfail(