sanketsaurav / lore

global statement detected PYL-W0603
Anti-pattern
Major
4 years ago5 years old
Using the global statement
 68        self.assertEqual(calls, 0)
 69
 70    def test_insert_batches(self):
 71        global calls 72        calls = 0
 73        lore.io.main.insert(self.table.name, self.dataframe, batch_size=100)
 74        self.assertEqual(calls, 0)
Using the global statement
 19calls = 0
 20@event.listens_for(Engine, "after_cursor_execute")
 21def count_sql_calls(conn, cursor, statement, parameters, context, executemany):
 22    global calls 23    calls += 1
 24
 25
Using the global statement
 62        self.assertEqual(self.dataframe['last_name'].tolist(), selected['last_name'].tolist())
 63
 64    def test_insert_bulk(self):
 65        global calls 66        calls = 0
 67        lore.io.main.insert(self.table.name, self.dataframe)
 68        self.assertEqual(calls, 0)
Using the global statement
169
170@contextmanager
171def timer(message='elapsed time:', level=logging.INFO, logger=None, librato=True):
172    global _librato, _nested_timers, _previous_timer_level, _ascii_pipes, _timer_logger173
174    if logger is None:
175        logger = _timer_logger
Using the global statement
365
366
367    def librato_record(name, value):
368        global _librato, _librato_lock, _librato_aggregator, _librato_timer, _librato_start369
370        if _librato is None:
371            return