@@ -82,7 +82,7 @@ class TestStartupData__Helper:
8282 # --------------------------------------------------------------------
8383 @staticmethod
8484 def GetStartTS () -> datetime .datetime :
85- assert type (__class__ .sm_StartTS ) == datetime .datetime # noqa: E721
85+ assert type (__class__ .sm_StartTS ) is datetime .datetime
8686 return __class__ .sm_StartTS
8787
8888 # --------------------------------------------------------------------
@@ -113,7 +113,7 @@ def CalcCurrentTestWorkerSignature() -> str:
113113 assert type (currentPID ) is int
114114
115115 startTS = __class__ .sm_StartTS
116- assert type (startTS ) == datetime .datetime # noqa: E721
116+ assert type (startTS ) is datetime .datetime
117117
118118 result = "pytest-{0:04d}{1:02d}{2:02d}_{3:02d}{4:02d}{5:02d}" .format (
119119 startTS .year ,
@@ -405,8 +405,8 @@ def helper__makereport__setup(
405405 assert outcome is not None
406406 # it may be pytest.Function or _pytest.unittest.TestCaseFunction
407407 assert isinstance (item , pytest .Function )
408- assert type (call ) == pytest .CallInfo # noqa: E721
409- assert type (outcome ) == T_PLUGGY_RESULT # noqa: E721
408+ assert type (call ) is pytest .CallInfo
409+ assert type (outcome ) is T_PLUGGY_RESULT
410410
411411 C_LINE1 = "******************************************************"
412412
@@ -416,7 +416,7 @@ def helper__makereport__setup(
416416
417417 rep : pytest .TestReport = outcome .get_result ()
418418 assert rep is not None
419- assert type (rep ) == pytest .TestReport # noqa: E721
419+ assert type (rep ) is pytest .TestReport
420420
421421 if rep .outcome == "skipped" :
422422 TEST_PROCESS_STATS .incrementNotExecutedTestCount ()
@@ -474,8 +474,8 @@ def helper__makereport__call(
474474 assert outcome is not None
475475 # it may be pytest.Function or _pytest.unittest.TestCaseFunction
476476 assert isinstance (item , pytest .Function )
477- assert type (call ) == pytest .CallInfo # noqa: E721
478- assert type (outcome ) == T_PLUGGY_RESULT # noqa: E721
477+ assert type (call ) is pytest .CallInfo
478+ assert type (outcome ) is T_PLUGGY_RESULT
479479
480480 # --------
481481 item_error_msg_count1 = item .stash .get (g_error_msg_count_key , 0 )
@@ -496,7 +496,7 @@ def helper__makereport__call(
496496 # --------
497497 rep = outcome .get_result ()
498498 assert rep is not None
499- assert type (rep ) == pytest .TestReport # noqa: E721
499+ assert type (rep ) is pytest .TestReport
500500
501501 # --------
502502 testID = helper__build_test_id (item )
@@ -505,12 +505,12 @@ def helper__makereport__call(
505505 assert call .start <= call .stop
506506
507507 startDT = datetime .datetime .fromtimestamp (call .start )
508- assert type (startDT ) == datetime .datetime # noqa: E721
508+ assert type (startDT ) is datetime .datetime
509509 stopDT = datetime .datetime .fromtimestamp (call .stop )
510- assert type (stopDT ) == datetime .datetime # noqa: E721
510+ assert type (stopDT ) is datetime .datetime
511511
512512 testDurration = stopDT - startDT
513- assert type (testDurration ) == datetime .timedelta # noqa: E721
513+ assert type (testDurration ) is datetime .timedelta
514514
515515 # --------
516516 exitStatus = None
@@ -519,7 +519,7 @@ def helper__makereport__call(
519519 assert call .excinfo is not None # research
520520 assert call .excinfo .value is not None # research
521521
522- if type (call .excinfo .value ) == _pytest .outcomes .Skipped : # noqa: E721
522+ if type (call .excinfo .value ) is _pytest .outcomes .Skipped :
523523 assert not hasattr (rep , "wasxfail" )
524524
525525 exitStatus = ExitStatusNames .SKIPPED
@@ -528,7 +528,7 @@ def helper__makereport__call(
528528
529529 TEST_PROCESS_STATS .incrementSkippedTestCount ()
530530
531- elif type (call .excinfo .value ) == _pytest .outcomes .XFailed : # noqa: E721 E501
531+ elif type (call .excinfo .value ) is _pytest .outcomes .XFailed :
532532 exitStatus = ExitStatusNames .XFAILED
533533 reasonText = str (call .excinfo .value )
534534 reasonMsgTempl = "XFAIL REASON: {0}"
@@ -544,7 +544,7 @@ def helper__makereport__call(
544544 reasonText = rep .wasxfail
545545 reasonMsgTempl = "XFAIL REASON: {0}"
546546
547- if type (call .excinfo .value ) == SIGNAL_EXCEPTION : # noqa: E721
547+ if type (call .excinfo .value ) is SIGNAL_EXCEPTION :
548548 pass
549549 else :
550550 logging .error (call .excinfo .value )
@@ -563,7 +563,7 @@ def helper__makereport__call(
563563 assert call .excinfo is not None
564564 assert call .excinfo .value is not None
565565
566- if type (call .excinfo .value ) == SIGNAL_EXCEPTION : # noqa: E721
566+ if type (call .excinfo .value ) is SIGNAL_EXCEPTION :
567567 assert item_error_msg_count > 0
568568 pass
569569 else :
@@ -614,8 +614,8 @@ def helper__makereport__call(
614614 pass
615615
616616 # --------
617- assert type (TEST_PROCESS_STATS .cTotalDuration ) == datetime .timedelta # noqa: E721
618- assert type (testDurration ) == datetime .timedelta # noqa: E721
617+ assert type (TEST_PROCESS_STATS .cTotalDuration ) is datetime .timedelta
618+ assert type (testDurration ) is datetime .timedelta
619619
620620 TEST_PROCESS_STATS .cTotalDuration += testDurration
621621
@@ -656,11 +656,11 @@ def pytest_runtest_makereport(item: pytest.Function, call: pytest.CallInfo):
656656 assert call is not None
657657 # it may be pytest.Function or _pytest.unittest.TestCaseFunction
658658 assert isinstance (item , pytest .Function )
659- assert type (call ) == pytest .CallInfo # noqa: E721
659+ assert type (call ) is pytest .CallInfo
660660
661661 outcome = yield
662662 assert outcome is not None
663- assert type (outcome ) == T_PLUGGY_RESULT # noqa: E721
663+ assert type (outcome ) is T_PLUGGY_RESULT
664664
665665 assert type (call .when ) is str
666666
@@ -808,7 +808,7 @@ def pytest_pyfunc_call(pyfuncitem: pytest.Function):
808808
809809 try :
810810 with LogWrapper2 () as logWrapper :
811- assert type (logWrapper ) == LogWrapper2 # noqa: E721
811+ assert type (logWrapper ) is LogWrapper2
812812 assert logWrapper ._old_method is not None
813813 assert type (logWrapper ._err_counter ) is int
814814 assert logWrapper ._err_counter == 0
@@ -821,7 +821,7 @@ def pytest_pyfunc_call(pyfuncitem: pytest.Function):
821821 r = yield
822822
823823 assert r is not None
824- assert type (r ) == T_PLUGGY_RESULT # noqa: E721
824+ assert type (r ) is T_PLUGGY_RESULT
825825
826826 assert logWrapper ._old_method is not None
827827 assert type (logWrapper ._err_counter ) is int
@@ -918,7 +918,7 @@ def helper__print_test_list2(tests: typing.List[T_TUPLE__str_int]) -> None:
918918 nTest = 0
919919
920920 for t in tests :
921- assert type (t ) == tuple # noqa: E721
921+ assert type (t ) is tuple
922922 assert len (t ) == 2
923923 assert type (t [0 ]) is str
924924 assert type (t [1 ]) is int
@@ -943,15 +943,15 @@ def pytest_sessionfinish():
943943 global g_worker_log_is_created # noqa: F824
944944
945945 assert g_test_process_kind is not None
946- assert type (g_test_process_kind ) == T_TEST_PROCESS_KIND # noqa: E721
946+ assert type (g_test_process_kind ) is T_TEST_PROCESS_KIND
947947
948948 if g_test_process_kind == T_TEST_PROCESS_KIND .Master :
949949 return
950950
951951 assert g_test_process_kind == T_TEST_PROCESS_KIND .Worker
952952
953953 assert g_test_process_mode is not None
954- assert type (g_test_process_mode ) == T_TEST_PROCESS_MODE # noqa: E721
954+ assert type (g_test_process_mode ) is T_TEST_PROCESS_MODE
955955
956956 if g_test_process_mode == T_TEST_PROCESS_MODE .Collect :
957957 return
@@ -1050,7 +1050,7 @@ def LOCAL__print_test_list2(
10501050 logging .info (" UNEXPECTED : {0}" .format (TEST_PROCESS_STATS .cUnexpectedTests ))
10511051 logging .info ("" )
10521052
1053- assert type (TEST_PROCESS_STATS .cTotalDuration ) == datetime .timedelta # noqa: E721
1053+ assert type (TEST_PROCESS_STATS .cTotalDuration ) is datetime .timedelta
10541054
10551055 LOCAL__print_line1_with_header ("TIME" )
10561056 logging .info ("" )
@@ -1136,8 +1136,8 @@ def pytest_configure(config: pytest.Config) -> None:
11361136 g_test_process_mode = helper__detect_test_process_mode (config )
11371137 g_test_process_kind = helper__detect_test_process_kind (config )
11381138
1139- assert type (g_test_process_kind ) == T_TEST_PROCESS_KIND # noqa: E721
1140- assert type (g_test_process_mode ) == T_TEST_PROCESS_MODE # noqa: E721
1139+ assert type (g_test_process_kind ) is T_TEST_PROCESS_KIND
1140+ assert type (g_test_process_mode ) is T_TEST_PROCESS_MODE
11411141
11421142 if g_test_process_kind == T_TEST_PROCESS_KIND .Master :
11431143 pass
0 commit comments