Skip to content

Commit fdfa122

Browse files
harsha509diemol
andauthored
Add: Python code sample for teardown (unittest framework) (#260) [deploy site]
Signed-off-by: Sri Harsha <[email protected]> Co-authored-by: Diego Molina <[email protected]>
1 parent 23630ca commit fdfa122

8 files changed

+32
-8
lines changed

docs_source_files/content/webdriver/browser_manipulation.de.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,10 @@ public static void tearDown() {
523523
}
524524
{{< / code-panel >}}
525525
{{< code-panel language="python" >}}
526-
# We don't have a Python code sample yet - Help us out and raise a PR
526+
# unittest teardown
527+
# https://docs.python.org/3/library/unittest.html?highlight=teardown#unittest.TestCase.tearDown
528+
def tearDown(self):
529+
self.driver.quit()
527530
{{< / code-panel >}}
528531
{{< code-panel language="csharp" >}}
529532
/*

docs_source_files/content/webdriver/browser_manipulation.en.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,10 @@ public static void tearDown() {
516516
}
517517
{{< / code-panel >}}
518518
{{< code-panel language="python" >}}
519-
# We don't have a Python code sample yet - Help us out and raise a PR
519+
# unittest teardown
520+
# https://docs.python.org/3/library/unittest.html?highlight=teardown#unittest.TestCase.tearDown
521+
def tearDown(self):
522+
self.driver.quit()
520523
{{< / code-panel >}}
521524
{{< code-panel language="csharp" >}}
522525
/*

docs_source_files/content/webdriver/browser_manipulation.es.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,10 @@ public static void tearDown() {
522522
}
523523
{{< / code-panel >}}
524524
{{< code-panel language="python" >}}
525-
# We don't have a Python code sample yet - Help us out and raise a PR
525+
# unittest teardown
526+
# https://docs.python.org/3/library/unittest.html?highlight=teardown#unittest.TestCase.tearDown
527+
def tearDown(self):
528+
self.driver.quit()
526529
{{< / code-panel >}}
527530
{{< code-panel language="csharp" >}}
528531
/*

docs_source_files/content/webdriver/browser_manipulation.fr.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,10 @@ public static void tearDown() {
519519
}
520520
{{< / code-panel >}}
521521
{{< code-panel language="python" >}}
522-
# We don't have a Python code sample yet - Help us out and raise a PR
522+
# unittest teardown
523+
# https://docs.python.org/3/library/unittest.html?highlight=teardown#unittest.TestCase.tearDown
524+
def tearDown(self):
525+
self.driver.quit()
523526
{{< / code-panel >}}
524527
{{< code-panel language="csharp" >}}
525528
/*

docs_source_files/content/webdriver/browser_manipulation.ja.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,10 @@ public static void tearDown() {
484484
}
485485
{{< / code-panel >}}
486486
{{< code-panel language="python" >}}
487-
# We don't have a Python code sample yet - Help us out and raise a PR
487+
# unittest teardown
488+
# https://docs.python.org/3/library/unittest.html?highlight=teardown#unittest.TestCase.tearDown
489+
def tearDown(self):
490+
self.driver.quit()
488491
{{< / code-panel >}}
489492
{{< code-panel language="csharp" >}}
490493
/*

docs_source_files/content/webdriver/browser_manipulation.ko.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,10 @@ public static void tearDown() {
522522
}
523523
{{< / code-panel >}}
524524
{{< code-panel language="python" >}}
525-
# We don't have a Python code sample yet - Help us out and raise a PR
525+
# unittest teardown
526+
# https://docs.python.org/3/library/unittest.html?highlight=teardown#unittest.TestCase.tearDown
527+
def tearDown(self):
528+
self.driver.quit()
526529
{{< / code-panel >}}
527530
{{< code-panel language="csharp" >}}
528531
/*

docs_source_files/content/webdriver/browser_manipulation.nl.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,10 @@ public static void tearDown() {
519519
}
520520
{{< / code-panel >}}
521521
{{< code-panel language="python" >}}
522-
# We don't have a Python code sample yet - Help us out and raise a PR
522+
# unittest teardown
523+
# https://docs.python.org/3/library/unittest.html?highlight=teardown#unittest.TestCase.tearDown
524+
def tearDown(self):
525+
self.driver.quit()
523526
{{< / code-panel >}}
524527
{{< code-panel language="csharp" >}}
525528
/*

docs_source_files/content/webdriver/browser_manipulation.zh-cn.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,10 @@ public static void tearDown() {driver.quit();
478478
}
479479
{{</ code-panel>}}
480480
{{<code-panel language="python">}}
481-
# 我们还没有 python 的示例代码,请帮助我们,并提交一个 PR
481+
# unittest teardown
482+
# https://docs.python.org/3/library/unittest.html?highlight=teardown#unittest.TestCase.tearDown
483+
def tearDown(self):
484+
self.driver.quit()
482485
{{</ code-panel>}}
483486
{{<code-panel language="csharp">}}
484487
/*

0 commit comments

Comments
 (0)