Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused variables #685

Merged
merged 1 commit into from
Sep 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/issues/test_03xx.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def test_326_handle_variants_in_par(self):

self.am37.in_par_assume = None
with self.assertRaises(HGVSError):
var_g = self.am37.c_to_g(var_c)
self.am37.c_to_g(var_c)

self.am37.in_par_assume = "X"
self.assertEqual(self.am37.c_to_g(var_c).ac, "NC_000023.10")
Expand Down
4 changes: 2 additions & 2 deletions tests/issues/test_437.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,10 @@ def test_enforce_strict_bounds(self):
# TODO: These exceptions are raised, but with the wrong message
# use `match=` arg
with pytest.raises(HGVSInvalidVariantError):
s2_g = self.am37.n_to_g(self.s2_n)
self.am37.n_to_g(self.s2_n)

with pytest.raises(HGVSInvalidVariantError):
e2_g = self.am37.n_to_g(self.e2_n)
self.am37.n_to_g(self.e2_n)


def test_oob_dup(parser, am37):
Expand Down
4 changes: 2 additions & 2 deletions tests/issues/test_602.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ def test_602(parser, am37):

hgvs.global_config.mapping.strict_bounds = True # default
with pytest.raises(HGVSInvalidIntervalError):
var_c = am37.g_to_c(var_g, "NM_006772.2")
am37.g_to_c(var_g, "NM_006772.2")

hgvs.global_config.mapping.strict_bounds = False
var_c = am37.g_to_c(var_g, "NM_006772.2") # No error
am37.g_to_c(var_g, "NM_006772.2") # No error


if __name__ == "__main__":
Expand Down
4 changes: 2 additions & 2 deletions tests/test_hgvs_edit.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
class Test_Edit(unittest.TestCase):
def test_NARefAlt_exceptions(self):
with self.assertRaises(HGVSError):
edit = str(hgvs.edit.NARefAlt(None, None))
str(hgvs.edit.NARefAlt(None, None))

def test_NARefAlt(self):
self.assertEqual(hgvs.edit.NARefAlt("A", "A").format(conf={"max_ref_length": None}), "A=")
Expand Down Expand Up @@ -87,7 +87,7 @@ def test_Repeat(self):

def test_Repeat_exceptions(self):
with self.assertRaises(HGVSError):
edit = str(hgvs.edit.Repeat("CAG", 34, 12))
str(hgvs.edit.Repeat("CAG", 34, 12))

def test_Inv(self):
self.assertEqual(str(hgvs.edit.Inv()), "inv")
Expand Down
1 change: 0 additions & 1 deletion tests/test_hgvs_location.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ def test_success(self):
def test_baseoffset_subtraction(self):
v30 = hgvs.location.BaseOffsetPosition(3, 0)
v50 = hgvs.location.BaseOffsetPosition(5, 0)
v52 = hgvs.location.BaseOffsetPosition(5, 2)
v54 = hgvs.location.BaseOffsetPosition(5, 4)

self.assertEqual(v50 - v30, 2)
Expand Down
5 changes: 2 additions & 3 deletions tests/test_hgvs_variantmapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def test_gcrp_invalid_input_type(self):
for key in cases:
try:
func, args = cases[key]
var_result = func(*args)
func(*args)
failures.append(key)
except hgvs.exceptions.HGVSInvalidVariantError:
pass
Expand All @@ -70,15 +70,14 @@ def test_gc_invalid_input_nm_accession(self):
hgvs_g = "NC_000007.13:g.36561662C>T"
var_g = self.hp.parse_hgvs_variant(hgvs_g)
with self.assertRaises(hgvs.exceptions.HGVSError):
var_p = self.vm.c_to_p(var_g, "NM_999999.1")
self.vm.c_to_p(var_g, "NM_999999.1")

def test_undefined_cds(self):
"""Raise exception when requesting mapping to/from c. with non-coding transcript"""
hgvs_n = "NR_111984.1:n.44G>A" # legit
hgvs_c = "NR_111984.1:c.44G>A" # bogus: c. with non-coding tx accession
var_n = self.hp.parse_hgvs_variant(hgvs_n)
var_c = self.hp.parse_hgvs_variant(hgvs_c)
tx_ac = var_n.ac

with self.assertRaises(hgvs.exceptions.HGVSUsageError):
var_c = self.vm.n_to_c(var_n) # n_to_c: transcript is non-coding
Expand Down
3 changes: 1 addition & 2 deletions tests/test_hgvs_variantmapper_cp_altseqbuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,10 @@ def test_delete_gene(self):

def test_sequence_with_length_that_is_not_divisible_by_3(self):
hgvsc = "NM_999992.2:c.1del"
expected_sequence = "AAAATCAAATGGGGTAGGCCCGGCAGCCAGCTTTATAGAGGAGGCAGTTTCGCC"
with self.assertRaises(NotImplementedError):
ac_p = "DUMMY"
var = self._parser.parse_hgvs_variant(hgvsc)
transcript_data = RefTranscriptData(hdp=self._datasource, tx_ac=var.ac, pro_ac=ac_p)
RefTranscriptData(hdp=self._datasource, tx_ac=var.ac, pro_ac=ac_p)

# def test_2_substitutions(self):
# pass
Expand Down