(self)
| 127 | self.assertGreaterEqual(result["exact"], 21) |
| 128 | |
| 129 | def test_generation(self): |
| 130 | stream_handler = logging.StreamHandler(sys.stdout) |
| 131 | logger.addHandler(stream_handler) |
| 132 | |
| 133 | testargs = ["run_generation.py", "--prompt=Hello", "--length=10", "--seed=42"] |
| 134 | model_type, model_name = ("--model_type=gpt2", "--model_name_or_path=sshleifer/tiny-gpt2") |
| 135 | with patch.object(sys, "argv", testargs + [model_type, model_name]): |
| 136 | result = run_generation.main() |
| 137 | self.assertGreaterEqual(len(result[0]), 10) |
nothing calls this directly
no outgoing calls
no test coverage detected