Code Duplication    Length = 23-24 lines in 2 locations

tests/test_level2_pp_cli.py 2 locations

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