1818 and Python boilerplates for setting up customized
1919 test frameworks.
2020"""
21- import codecs
2221import colorama
2322import os
2423import sys
@@ -114,7 +113,7 @@ def main():
114113 data .append (seleniumbase_req )
115114 data .append ("" )
116115 file_path = "%s/%s" % (dir_name , "requirements.txt" )
117- file = codecs . open (file_path , "w+" , "utf-8" )
116+ file = open (file_path , "w+" , "utf-8" )
118117 file .writelines ("\r \n " .join (data ))
119118 file .close ()
120119
@@ -152,7 +151,7 @@ def main():
152151 data .append (" production: custom marker" )
153152 data .append ("" )
154153 file_path = "%s/%s" % (dir_name , "pytest.ini" )
155- file = codecs . open (file_path , "w+" , "utf-8" )
154+ file = open (file_path , "w+" , "utf-8" )
156155 file .writelines ("\r \n " .join (data ))
157156 file .close ()
158157
@@ -169,14 +168,14 @@ def main():
169168 data .append ("show_skipped=false" )
170169 data .append ("show_timings=false" )
171170 file_path = "%s/%s" % (dir_name , "setup.cfg" )
172- file = codecs . open (file_path , "w+" , "utf-8" )
171+ file = open (file_path , "w+" , "utf-8" )
173172 file .writelines ("\r \n " .join (data ))
174173 file .close ()
175174
176175 data = []
177176 data .append ("" )
178177 file_path = "%s/%s" % (dir_name , "__init__.py" )
179- file = codecs . open (file_path , "w+" , "utf-8" )
178+ file = open (file_path , "w+" , "utf-8" )
180179 file .writelines ("\r \n " .join (data ))
181180 file .close ()
182181
@@ -312,7 +311,7 @@ def main():
312311 data .append ("temp_*/" )
313312 data .append ("node_modules" )
314313 file_path = "%s/%s" % (dir_name , ".gitignore" )
315- file = codecs . open (file_path , "w+" , "utf-8" )
314+ file = open (file_path , "w+" , "utf-8" )
316315 file .writelines ("\r \n " .join (data ))
317316 file .close ()
318317
@@ -324,7 +323,7 @@ def main():
324323 data .append (" ├── requirements.txt" )
325324 data .append (" └── setup.cfg" )
326325 file_path = "%s/%s" % (dir_name , "outline.rst" )
327- file = codecs . open (file_path , "w+" , "utf-8" )
326+ file = open (file_path , "w+" , "utf-8" )
328327 file .writelines ("\r \n " .join (data ))
329328 file .close ()
330329 os .system ("sbase print %s -n" % file_path )
@@ -368,7 +367,7 @@ def main():
368367 data .append (' self.assert_element("div#login_button_container")' )
369368 data .append ("" )
370369 file_path = "%s/%s" % (dir_name , "my_first_test.py" )
371- file = codecs . open (file_path , "w+" , "utf-8" )
370+ file = open (file_path , "w+" , "utf-8" )
372371 file .writelines ("\r \n " .join (data ))
373372 file .close ()
374373
@@ -461,7 +460,7 @@ def main():
461460 data .append (' self.assert_text("SeleniumBase", "h2")' )
462461 data .append ("" )
463462 file_path = "%s/%s" % (dir_name , "test_demo_site.py" )
464- file = codecs . open (file_path , "w+" , "utf-8" )
463+ file = open (file_path , "w+" , "utf-8" )
465464 file .writelines ("\r \n " .join (data ))
466465 file .close ()
467466
@@ -500,7 +499,7 @@ def main():
500499 data .append (' self.assert_title_contains(title_text)' )
501500 data .append ("" )
502501 file_path = "%s/%s" % (dir_name , "parameterized_test.py" )
503- file = codecs . open (file_path , "w+" , "utf-8" )
502+ file = open (file_path , "w+" , "utf-8" )
504503 file .writelines ("\r \n " .join (data ))
505504 file .close ()
506505
@@ -510,7 +509,7 @@ def main():
510509 data = []
511510 data .append ("" )
512511 file_path = "%s/%s" % (dir_name_2 , "__init__.py" )
513- file = codecs . open (file_path , "w+" , "utf-8" )
512+ file = open (file_path , "w+" , "utf-8" )
514513 file .writelines ("\r \n " .join (data ))
515514 file .close ()
516515
@@ -545,7 +544,7 @@ def main():
545544 data .append (" pass" )
546545 data .append ("" )
547546 file_path = "%s/%s" % (dir_name_2 , "base_test_case.py" )
548- file = codecs . open (file_path , "w+" , "utf-8" )
547+ file = open (file_path , "w+" , "utf-8" )
549548 file .writelines ("\r \n " .join (data ))
550549 file .close ()
551550
@@ -554,7 +553,7 @@ def main():
554553 data .append (' html = "html"' )
555554 data .append ("" )
556555 file_path = "%s/%s" % (dir_name_2 , "page_objects.py" )
557- file = codecs . open (file_path , "w+" , "utf-8" )
556+ file = open (file_path , "w+" , "utf-8" )
558557 file .writelines ("\r \n " .join (data ))
559558 file .close ()
560559
@@ -570,7 +569,7 @@ def main():
570569 data .append (" self.assert_element(Page.html)" )
571570 data .append ("" )
572571 file_path = "%s/%s" % (dir_name_2 , "boilerplate_test.py" )
573- file = codecs . open (file_path , "w+" , "utf-8" )
572+ file = open (file_path , "w+" , "utf-8" )
574573 file .writelines ("\r \n " .join (data ))
575574 file .close ()
576575
@@ -594,7 +593,7 @@ def main():
594593 data .append (' DataPage().add_input_text(self, "Goodbye!")' )
595594 data .append ("" )
596595 file_path = "%s/%s" % (dir_name_2 , "classic_obj_test.py" )
597- file = codecs . open (file_path , "w+" , "utf-8" )
596+ file = open (file_path , "w+" , "utf-8" )
598597 file .writelines ("\r \n " .join (data ))
599598 file .close ()
600599
@@ -614,7 +613,7 @@ def main():
614613 data .append (' DataPage().add_input_text(sb, "Goodbye!")' )
615614 data .append ("" )
616615 file_path = "%s/%s" % (dir_name_2 , "sb_fixture_test.py" )
617- file = codecs . open (file_path , "w+" , "utf-8" )
616+ file = open (file_path , "w+" , "utf-8" )
618617 file .writelines ("\r \n " .join (data ))
619618 file .close ()
620619
@@ -624,7 +623,7 @@ def main():
624623 data = []
625624 data .append ("" )
626625 file_path = "%s/%s" % (dir_name_3 , "__init__.py" )
627- file = codecs . open (file_path , "w+" , "utf-8" )
626+ file = open (file_path , "w+" , "utf-8" )
628627 file .writelines ("\r \n " .join (data ))
629628 file .close ()
630629
@@ -652,7 +651,7 @@ def main():
652651 )
653652 data .append ("" )
654653 file_path = "%s/%s" % (dir_name_3 , "google_test.py" )
655- file = codecs . open (file_path , "w+" , "utf-8" )
654+ file = open (file_path , "w+" , "utf-8" )
656655 file .writelines ("\r \n " .join (data ))
657656 file .close ()
658657
@@ -670,7 +669,7 @@ def main():
670669 data .append (' search_results = "div#center_col"' )
671670 data .append ("" )
672671 file_path = "%s/%s" % (dir_name_3 , "google_objects.py" )
673- file = codecs . open (file_path , "w+" , "utf-8" )
672+ file = open (file_path , "w+" , "utf-8" )
674673 file .writelines ("\r \n " .join (data ))
675674 file .close ()
676675
@@ -702,7 +701,7 @@ def main():
702701 data .append (' self.assert_element("div#login_button_container")' )
703702 data .append ("" )
704703 file_path = "%s/%s" % (dir_name_3 , "swag_labs_test.py" )
705- file = codecs . open (file_path , "w+" , "utf-8" )
704+ file = open (file_path , "w+" , "utf-8" )
706705 file .writelines ("\r \n " .join (data ))
707706 file .close ()
708707
@@ -729,7 +728,7 @@ def main():
729728 data .append (' sb.assert_element("div#login_button_container")' )
730729 data .append ("" )
731730 file_path = "%s/%s" % (dir_name_3 , "sb_swag_test.py" )
732- file = codecs . open (file_path , "w+" , "utf-8" )
731+ file = open (file_path , "w+" , "utf-8" )
733732 file .writelines ("\r \n " .join (data ))
734733 file .close ()
735734
@@ -756,7 +755,7 @@ def main():
756755 data .append (" ├── sb_swag_test.py" )
757756 data .append (" └── swag_labs_test.py" )
758757 file_path = "%s/%s" % (dir_name , "outline.rst" )
759- file = codecs . open (file_path , "w+" , "utf-8" )
758+ file = open (file_path , "w+" , "utf-8" )
760759 file .writelines ("\r \n " .join (data ))
761760 file .close ()
762761 if " " not in file_path :
0 commit comments