I have two classes and one is using selenium to scrape like 25 different pages and it takes a really long time. I have another class that would take 1 second to run but its calling a variable from the other class. I want self.numbers to equal data.scores and somehow keep the value set so that testing will only take a second. The class that takes forever is AllData() and I want self.numbers to persist without having to copy and paste the printed value.
from collections import defaultdict
from data import *
class Test:
def __init__(self,):
data = AllData()
self.numbers = data.scores