We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2face67 commit ac3d797Copy full SHA for ac3d797
axe_selenium_python/axe.py
@@ -93,17 +93,19 @@ def report(self, violations):
93
string += "\n\n\n"
94
return string
95
96
- def write_results(self, data, name="results.json"):
+ def write_results(self, data, name):
97
"""
98
Write JSON to file with the specified name.
99
100
:param name: Name of file to be written to.
101
:param output: JSON object.
102
103
- filepath = os.path.join(os.getcwd(), name)
+ filepath = os.path.abspath(name)
104
105
with open(filepath, "w", encoding="utf8") as f:
106
try:
107
f.write(unicode(json.dumps(data, indent=4)))
108
except NameError:
109
f.write(json.dumps(data, indent=4))
110
+ except FileNotFoundError as fnf_error:
111
+ print(fnf_error)
0 commit comments