Using the formula provided by Stan in his answer to his own question and plugging in the values for $N$, $p$ and $q$ in the question, i.e.
Population: $N = 1,000,000$
proportion of white marbles: $p = 0.001$
proportion of black marbles: $q = 1 - p$
and assuming a precision
$E = 0.05$
we end up with
$$
n = \frac{1,000,000 \cdot z_{1-\alpha / 2}^2 \cdot 0.000999}{2499.998 + z_{1-\alpha / 2}^2 \cdot 0.000999}
$$
Here we need a clarification:
$z$ is not the confidence level but usually interpreted as the $(1-\alpha/2)$ quantile of the standard normal Distribution.
The confidence level is $1-\alpha$.
Typical values of $\alpha$ are 0.01, 0.05 and 0.1 and are set to control the probability of error type 1 in hypothesis testing. Wikipedia
Using the $(1-\alpha/2)$ quantile implies we want to conduct a two sided hypothesis test (otherwise we would have to use the $(1-\alpha)$ quantile).
Back to the example:
Let's use $\alpha = 0.01$, i.e. an 99% confidence level. Now we get a result for sample size $n$:
$$
\begin{align}
n &= \frac{1,000,000 \cdot 2.58^2 \cdot 0.000999}{2499.998 + 2.58^2 \cdot 0.000999}\\
&= 2.6513
\end{align}
$$
Discussion of result:
Clearly it is impractical to draw 2.6513 marbles from the urn. Thus drawing 2 or 3 marbles are the options to choose from.
Neither would be very satisfying...
Imagine we opt for drawing 3 marbles. What are the probabilities of drawing 0, 1, 2 or even 3 white marbles?
$P(0) = 0.997003$
$P(1) = 0.002994009$
$P(2) \approx 0$
$P(3) \approx 0$
Regarding a hypothesis test $H_0: p_0 = 0.001$ we are fine because the chances of rejecting the true hypothesis are at most 1% (as required by setting $\alpha = 0.01$).
Caution:
If it is not just about hypothesis testing but also about estimating the proportion of white marbles in the population you would not want to do this based on a sample size of just 3, because your estimate would be limited by design to the values 0%, 33.3%, 66.% or 100%. Not quite what you had in mind when specifying a precision of 0.05 (i.e. 5 percentage points).