def test_str_repr(self): stepm = StepM(self.benchmark_series, self.models, size=0.10) expected = 'StepM(FWER (size): 0.10, studentization: ' \ 'asymptotic, bootstrap: ' + str(stepm.spa.bootstrap) + ')' assert_equal(str(stepm), expected) expected = expected[:-1] + ', ID: ' + hex(id(stepm)) + ')' assert_equal(stepm.__repr__(), expected) expected = ('<strong>StepM</strong>(' '<strong>FWER (size)</strong>: 0.10, ' '<strong>studentization</strong>: asymptotic, ' '<strong>bootstrap</strong>: ' + str(stepm.spa.bootstrap) + ', ' + '<strong>ID</strong>: ' + hex(id(stepm)) + ')') assert_equal(stepm._repr_html_(), expected) stepm = StepM(self.benchmark_series, self.models, size=0.05, studentize=False) expected = 'StepM(FWER (size): 0.05, studentization: none, ' \ 'bootstrap: ' + str(stepm.spa.bootstrap) + ')' assert_equal(expected, str(stepm))
def test_str_repr(self): stepm = StepM(self.benchmark_series, self.models, size=0.10) expected = ("StepM(FWER (size): 0.10, studentization: " "asymptotic, bootstrap: " + str(stepm.spa.bootstrap) + ")") assert_equal(str(stepm), expected) expected = expected[:-1] + ", ID: " + hex(id(stepm)) + ")" assert_equal(stepm.__repr__(), expected) expected = ("<strong>StepM</strong>(" "<strong>FWER (size)</strong>: 0.10, " "<strong>studentization</strong>: asymptotic, " "<strong>bootstrap</strong>: " + str(stepm.spa.bootstrap) + ", " + "<strong>ID</strong>: " + hex(id(stepm)) + ")") assert_equal(stepm._repr_html_(), expected) stepm = StepM(self.benchmark_series, self.models, size=0.05, studentize=False) expected = ("StepM(FWER (size): 0.05, studentization: none, " "bootstrap: " + str(stepm.spa.bootstrap) + ")") assert_equal(expected, str(stepm))