Skip to content

Commit

Permalink
Fix class name in Python Tests (#36538)
Browse files Browse the repository at this point in the history
metricbeat/tests/system/test_lightmodules.py was failing, it seems we
had a custom class with the name starting in 'Test' and that was
confusing pytest. This commit fixes the issue by renaming the class.
  • Loading branch information
belimawr authored Sep 8, 2023
1 parent 80ed33b commit fbecc23
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions metricbeat/tests/system/test_lightmodules.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ def test_processors(self):

@contextmanager
def http_test_server():
server = http.server.HTTPServer(('localhost', 0), TestHTTPHandler)
server = http.server.HTTPServer(('localhost', 0), HTTPHandlerForTest)
child = threading.Thread(target=server.serve_forever)
child.start()
yield server
server.shutdown()
child.join()


class TestHTTPHandler(http.server.BaseHTTPRequestHandler):
class HTTPHandlerForTest(http.server.BaseHTTPRequestHandler):
def do_GET(self):
self.send_response(200)
self.send_header("Content-type", "application/json")
Expand Down

0 comments on commit fbecc23

Please sign in to comment.