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 df3300d commit e85ea45Copy full SHA for e85ea45
axe_selenium_python/axe.py
@@ -93,14 +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=None):
97
"""
98
Write JSON to file with the specified name.
99
100
- :param name: Name of file to be written to.
+ :param name: Path to the file to be written to. If no path is passed
101
+ a new file will be created.
102
:param output: JSON object.
103
- filepath = os.path.join(os.getcwd(), name)
104
+
105
+ if name:
106
+ filepath = os.path.abspath(name)
107
+ else:
108
+ filepath = os.path.join(os.path.getcwd(), name)
109
110
with open(filepath, "w", encoding="utf8") as f:
111
try:
0 commit comments